Skip to content

GDD: trigger chain selection when caught-up #1505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 16, 2025

Conversation

amesgen
Copy link
Member

@amesgen amesgen commented May 12, 2025

Closes #1503

The first commit adds a regression test, which is then fixed by the second and third commit in this PR. Reverting either commit makes the regression test fail as expected.

amesgen added 3 commits May 12, 2025 16:53
When Genesis is disable statically, we never even schedule any LoE reprocessing,
so this doesn't change anything in this situation.

When Genesis is disabled and we are caught-up, then there are concrete scenarios
where we want to reprocess LoE blocks, see the preceding two commits.
@amesgen amesgen requested a review from nfrisby as a code owner May 12, 2025 14:59
@amesgen amesgen added the Genesis PRs related to Genesis testing and implementation label May 12, 2025
@amesgen amesgen self-assigned this May 12, 2025
@amesgen amesgen moved this to 👀 In review in Consensus Team Backlog May 12, 2025
Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nix-shell:~/cardano-haskell]$ (cd ouroboros-consensus; git lg -5)
429d26d89 - (HEAD -> amesgen/genesis-caughtup-final-chainsel) Revert "GDD: trigger chain selection when caught-up" (13 hours ago) <Nicolas Frisby>
aa3350358 - Revert "ChainSel: reprocess LoE-delayed blocks even when LoE is disabled" (13 hours ago) <Nicolas Frisby>
5c2bd47cf - (origin/amesgen/genesis-caughtup-final-chainsel) ChainSel: reprocess LoE-delayed blocks even when LoE is disabled (4 days ago) <Alexander Esgen>
b4e886f50 - GDD: trigger chain selection when caught-up (4 days ago) <Alexander Esgen>
f2ba4bcd1 - Regression test for #1503 (4 days ago) <Alexander Esgen>

[nix-shell:~/cardano-haskell]$ x=ouroboros-consensus-diffusion:test:consensus-test; cabal build $x && cabal run $x -- -p'/Select best chain when CaughtUp/'
Up to date
ouroboros-consensus
  Genesis tests
    LoE
      Select best chain when CaughtUp: FAIL
        *** Failed! Falsified (after 1 test):
        Schedule control: ControlDefault
        No thread delayed
        Selection tip is not C
        At (Block {blockPointSlot = SlotNo 1, blockPointHash = (testHashFromList [2])}) /= At (Block {blockPointSlot = SlotNo 2, blockPointHash = (testHashFromList [1,0])})
        Use --quickcheck-replay="(SMGen 9786910051759926736 5637335760815486691,0)" to reproduce.

1 out of 1 tests failed (0.01s)

[nix-shell:~/cardano-haskell]$ (cd ouroboros-consensus; git reset --hard HEAD^^)
HEAD is now at 5c2bd47cf ChainSel: reprocess LoE-delayed blocks even when LoE is disabled

[nix-shell:~/cardano-haskell]$ x=ouroboros-consensus-diffusion:test:consensus-test; cabal build $x && cabal run $x -- -p'/Select best chain when CaughtUp/'
*snip: recompilation*
ouroboros-consensus
  Genesis tests
    LoE
      Select best chain when CaughtUp: OK (1.38s)
        +++ OK, passed 1000 tests.
        
        Branching factor (78000 in total):
        51.282% 0
        28.205% 1
        11.538% 3
         7.692% 2
         1.282% 10-19
        
        Modified schedules explored (1000 in total):
        100.0% 70-79
        
        Race reversals per schedule (78000 in total):
        56.410% 2
        39.744% 1
         2.564% 3
         1.282% 0

All 1 tests passed (1.39s)

@amesgen amesgen added this pull request to the merge queue May 16, 2025
Merged via the queue into main with commit 515ba88 May 16, 2025
28 of 35 checks passed
@amesgen amesgen deleted the amesgen/genesis-caughtup-final-chainsel branch May 16, 2025 14:19
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Consensus Team Backlog May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Genesis PRs related to Genesis testing and implementation
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Genesis: Trigger final chain selection when caught-up
2 participants